package com.wsx.rpc.comsat;

import co.paralleluniverse.fibers.Fiber;
import co.paralleluniverse.fibers.SuspendExecution;
import co.paralleluniverse.strands.SuspendableCallable;

import java.util.concurrent.ExecutionException;

/**
 * @author wangshuaixin
 * @Title: com.wsx.rpc.comsat.Test
 * @Description: TODO
 * @date 2018/11/19
 */
public class Test {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        Fiber<String> fiber = new Fiber<String>(new SuspendableCallable<String>() {
            @Override
            public String run() throws SuspendExecution, InterruptedException {
                System.out.println("hello");
                return "hello";
            }
        }).start();

        System.out.println(fiber.get());
    }
}
